# ##########################################
SET( INCLUDE_DIRS
	${CMAKE_CURRENT_LIST_DIR}/Include
)
INCLUDE_DIRECTORIES( ${INCLUDE_DIRS} )


# ##########################################
SET( INCLUDE_FILES
	Include/Core/Config.hpp
	Include/Core/Core.hpp
)

# ##########################################
SET( SOURCE_FILES
	Source/Core.cpp
)

# ##########################################
# Some utility files.
SET( UTILITY_FILES
	../../Config.hpp.in
	../CMakeLists.txt
)


# ##########################################
# Let's make things pretty in IDE's.
SOURCE_GROUP( "Core Includes" FILES ${INCLUDE_FILES} )

SOURCE_GROUP( "Core Source" FILES ${SOURCE_FILES} )

SOURCE_GROUP( "Utilities" FILES ${UTILITY_FILES} )


# ##########################################
ADD_DEFINITIONS( -DBUILDING_CORE )

ADD_LIBRARY( Core
	STATIC
	${INCLUDE_FILES}
	${SOURCE_FILES}
	${UTILITY_FILES}
)

# ##########################################
# Export the include directory.
SET( CORE_INCLUDE_DIRS ${INCLUDE_DIRS} PARENT_SCOPE )


# ##########################################
# Make a unit test holder for the Math library.
IF( BUILD_UNIT_TESTS )
	# Add the gmock include directories.
	INCLUDE_DIRECTORIES( ${GMOCK_INCLUDE_DIRS} )

	ADD_EXECUTABLE( _TestCore
		Tests/Main.cpp
		Tests/TestAll.hpp
	)
	TARGET_LINK_LIBRARIES( _TestCore
		Core
		GMock
		${CMAKE_THREAD_LIBS_INIT}
	)

	ADD_TEST( NAME
		_TestCore
		COMMAND
		_TestCore
	)
ENDIF( BUILD_UNIT_TESTS )
